package Collection1;

import java.util.ArrayList;
import java.util.Collection;

public class Collection3 {
    public static void main(String[] args) {
        Collection<String> list = new ArrayList<>();
        list.add("A");
        list.add("B");
        list.add("C");

        // forEach + Lambda表达式（Java 8+）
        list.forEach(element -> System.out.println(element));
        list.forEach(System.out::println);
    }
}
